<template>
  <div>
    <router-view/>
<!--    <van-notice-bar v-if="isLogin" mode="link" class="advice"><div @click="toLogin">您还未登录，点击去登录  ></div></van-notice-bar>-->
    <div v-if="isLogin" class="advice" @click="toLogin">&nbsp;&nbsp;&nbsp;您还未登录，点击去登录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;></div>
    <!--    吸底-->
    <van-tabbar v-model="active1">
      <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
      <van-tabbar-item icon="search" to="/sorts">分类</van-tabbar-item>
      <van-tabbar-item icon="shopping-cart-o" to="cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="manager-o" to="personCenter">个人</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'app_index',
  data () {
    return {
      tabList: ['面食','烧烤','火锅','小吃','夜宵','早餐','网红食品','奶茶'],
      imgObj: ['http://p0.meituan.net/codeman/a97baf515235f4c5a2b1323a741e577185048.jpg',
      'http://p1.meituan.net/codeman/826a5ed09dab49af658c34624d75491861404.jpg'],
      goods_icon:[
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/073a4be8c4ba38e53ffc247ee526bc2c.png?quality=95&type=webp&imageView',
          goods_txt: '乳品饮料'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/79b9d2e7a3c232b34972975cc1b6d644.png?quality=95&type=webp&imageView',
          goods_txt: '香辣烧烤'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        },
        {
          imgurl: 'https://yanxuan.nosdn.127.net/7dd4adbc8cb5f41f44a136398f0653ec.png?quality=95&type=webp&imageView',
          goods_txt: '饼干糕点'
        }
      ],
      active1: '',
      value:'',
      active:'',
      storeList:[
        {
          imgUrl: require('../../image/demo1.png'),
          store_name: '麻辣香锅'
        },
        {
          imgUrl: require('../../image/demo1.png'),
          store_name: '麻辣香锅'
        },
        {
          imgUrl: require('../../image/demo1.png'),
          store_name: '麻辣香锅'
        }
      ],
      isLogin:false
    }
  },
  methods:{
    jump(path){
      let list = window.location.href.split('/')
      console.log(list)
      console.log(list[list.length-1])
      console.log(path)
      console.log(list[list.length-1]===path)
      if (list[list.length-1]===path.substring(1)){
        return
      }
      this.$router.replace(path)
      console.log(window.location.href)
    },
    toLogin(){
      this.$router.push("/login")
    }
  },
  created() {
    if (window.localStorage.getItem("Authorization")){
      this.isLogin = false
    }else {
      this.isLogin = true
    }
  }


}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.advice{
  position: fixed;
  bottom: .8rem;
  height: .6rem;
  background-color: rgba(158,128,41,0.3);
  width: 100vh;
  line-height: .6rem;
  font-size: .25rem;
  color: orangered;
}

</style>
